home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5364 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.0 KB  |  115 lines

  1. Path: cs.man.ac.uk!limc
  2. From: limc@cs.man.ac.uk (S93)
  3. Newsgroups: comp.lang.c
  4. Subject: Starting an application in a Borland C program
  5. Date: 12 Feb 1996 15:09:13 GMT
  6. Organization: Dept of Computer Science, University of Manchester, U.K.
  7. Message-ID: <4fnl6p$p2u@m1.cs.man.ac.uk>
  8. NNTP-Posting-Host: n3i.cs.man.ac.uk
  9. NNTP-Posting-User: 15113
  10.  
  11.  
  12. I have tried to start netscape navigator from within my own Borland C program
  13. using the
  14. execlp command. But the linker error message > undefined symbol _execlp keeps
  15. popping up. I
  16. have definitely define the header file process.h, checked the
  17. Menu|options|linker, and i even
  18. add the header file as a node in the project. Is there anybody who can help?
  19.  
  20. P/s i have included the .c and .rc files below
  21.  
  22. cheers
  23. cheeyuen
  24. ==============================================================================
  25.  
  26.  
  27. /* NET.C */
  28.  
  29. #include <stdio.h>
  30. #include <errno.h>
  31. #include <stdlib.h>
  32. #include <process.h>
  33. #include <windows.h>
  34.  
  35. #define        UNAMEBOX    100
  36.  
  37. //---------------------------------------------------------------
  38. //   Name:      InternetSearchWndProc
  39. //   Purpose:   Dialog procedure for internet search dialog.
  40. //---------------------------------------------------------------
  41.  
  42. #pragma argsused
  43.  
  44. BOOL FAR PASCAL _export InternetSearchWndProc (HWND hDlg, UINT Msg,
  45.                      WPARAM wParam, LPARAM lParam)
  46. {
  47.      switch (Msg)
  48.      {
  49.     case WM_INITDIALOG:
  50.  
  51.     SetFocus (GetDlgItem (hDlg, UNAMEBOX));
  52.     return (FALSE);
  53.  
  54.     case WM_COMMAND:
  55.  
  56.     if  (wParam == IDCANCEL)
  57.             EndDialog (hDlg, wParam);
  58.     if  (wParam == IDOK)
  59.          {
  60.             EndDialog (hDlg, wParam);
  61.             MessageBox(NULL, "Internet search is not implemented. Select OK to assess
  62. internet manually.", "BDS(Internet Search)", MB_ICONEXCLAMATION | MB_OK);
  63.             execlp("m:\winsock\netscape\netscape.exe", NULL);
  64.          }
  65.     break;
  66.  
  67.     default:
  68.  
  69.           return (FALSE);
  70.      }
  71.  
  72.      return (TRUE);
  73. }
  74.  
  75.  
  76. //---------------------------------------------------------------
  77. //   Name:      WinMain
  78. //   Purpose:   Program entry point
  79. //---------------------------------------------------------------
  80.  
  81. #pragma argsused
  82.  
  83. int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
  84.              LPSTR lpCmdLine, int nCmdShow)
  85. {
  86.      FARPROC lpfnDialogProc;
  87.  
  88.      lpfnDialogProc = MakeProcInstance (InternetSearchWndProc, hInstance);
  89.      DialogBox (hInstance, "INTERNETSEARCH", NULL, lpfnDialogProc);
  90.      FreeProcInstance (lpfnDialogProc);
  91.      return (0);
  92. }
  93.  
  94.  
  95.  
  96.  
  97. =========================================================================INTERNE
  98. ETSEARCH DIALOG 90, 60, 175, 110
  99. STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  100. CAPTION "Business Data System(Internet Search)"
  101. BEGIN
  102.     DEFPUSHBUTTON "&OK", 1, 33, 80, 35, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
  103.     PUSHBUTTON "&Cancel", 2, 87, 80, 35, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
  104.     LTEXT "Please enter the internet address:", -1, 10, 12, 143, 11, WS_CHILD |
  105. WS_VISIBLE | WS_GROUP
  106.     EDITTEXT 100, 11, 26, 137, 12, ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER |
  107. WS_TABSTOP
  108.     LTEXT "Name of share:", -2, 10, 45, 143, 11, WS_CHILD | WS_VISIBLE | WS_GROUP
  109.     EDITTEXT 101, 11, 60, 137, 12, ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER |
  110. WS_TABSTOP
  111. END
  112.  
  113.  
  114.  
  115.